function createXHR()
{
	try { return new XMLHttpRequest(); } catch(e) {}
	try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e) {}
	try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e) {}
	try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
	try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}

	alert("XMLHttpRequest not supported");
	return null;
}

function sendRequest(url,divarray)
{
	var xhr = createXHR();
	if (xhr)
	{
		xhr.open("GET",url,true);
		if(divarray!=''){
			xhr.onreadystatechange = function(){handleResponse(xhr,divarray);};
			xhr.send(null);
		}
	}
}

function handleResponse(xhr,divarray)
{
	if (xhr.readyState == 4  && xhr.status == 200)
	{
		var parsedResponse = xhr.responseXML;
		var divname = new Array();
		var return_textarray = new Array();
		var return_text = xhr.responseText;
		if(divarray=="batcharg") {
			if(return_text!="no") confirm("该月已有"+return_text+"的排班记录，确认重新排班，覆盖原先的排班记录吗？");
			return false;
		}else if(divarray=="batchmembers") {
			if(return_text!="no") confirm("该月已安排人员值班，点确定将覆盖该月原先的人员排班记录！");
			return false;
		}
		//alert(typeof(divarray));
		if(divarray || typeof(divarray)!='undefined') {
			divname = divarray.split("|");
			return_textarray = return_text.split("|");
			for(i = 0;i<divname.length;i++){
				document.getElementById(divname[i]).innerHTML = return_textarray[i];
			}
		}
		//var msg = xhr.responseText;
		//var responseOutput = this.parent.frames["left"].document.getElementById("tasklist__box");
		//responseOutput.innerHTML = msg;
	}
}